/********************************************************************

Define common math exceptions.

Write Date: 2011/03/23
Author: Deng Nianchen
>>>> The file contains following classes:
>>>> MathException
>>>> DivideZeroException

*********************************************************************/
#ifndef MATH_EXCEPTIONS_HPP
#define MATH_EXCEPTIONS_HPP
#include "OOPException.hpp"

_OOPUTILS_BEGIN

/**************************************************************************************************
 * <summary>  Exception for signalling general mathematics errors.  </summary>
 *
 * <remarks>  Deng Nianchen, 2011/3/24. </remarks>
 **************************************************************************************************/

class MathException : public OOPException
{

public:

	virtual OOPString getReson ()
	{
		L"Unknown math exception.";
	}

};

/**************************************************************************************************
 * <summary>  Exception for signalling divid-zero errors.  </summary>
 *
 * <remarks>  Deng Nianchen, 2011/3/24. </remarks>
 **************************************************************************************************/

class DividZeroException : public MathException
{

public:

	virtual OOPString getReson ()
	{
		return L"Cannot divide 0.";
	}

};

_OOPUTILS_END

#endif